package com.yanggu.scala.chapater12.var2

//模式匹配-变量声明时进行模式匹配
object MatchVarDemo02 {

  def main(args: Array[String]): Unit = {
    val (x, y, z) = (1, 2, "Hello")
    printf(s"$x, $y, $z")

    println()

    val (q, r) = BigInt(10) /% 3
    //这里q = BigInt(10) / 3; q = BigInt(10) % 3
    printf(s"$q, $r")

    println()

    val arr = Array(1, 2, 3, 4)
    val Array(first, second, _ *) = arr
    printf(s"$first, $second")
  }

}
